Skip to main content

Pods DNS - Configs and Policies

In Kubernetes Networking everything is virtualized - where inter-pod communication is done via CNI - or better rephrased, this responsibility is from a CNI. In many cases, when Pods are hosted on the same network - the "network" calls never leave the kernel-level and are routed by Linux Namespaces. Kubernetes exposes a lot of different possibilities of DNS configuration for Pods - up to using the Cluster configuration, no DNS config, specifying the nameservers, options and much more. In this post - we are going to compare the impacts of DNS Policies and Configs on Pod deployments.

DNSPolicy: None

With this config - the Pods /etc/resolv.conf will have at least 1 nameserver configured in spec.dnsConfig.nameservers

DNSPolicy: Default

DNSPolicy: ClusterFirst